home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / lines1 / lines016.jar / lines / LinesTimer.class (.txt) < prev   
Encoding:
Java Class File  |  2002-04-29  |  612 b   |  28 lines

  1. package lines;
  2.  
  3. import java.util.Timer;
  4. import java.util.TimerTask;
  5.  
  6. class LinesTimer extends TimerTask {
  7.    LinesCanvas parent;
  8.    Timer timer;
  9.  
  10.    LinesTimer(LinesCanvas var1) {
  11.       this.parent = var1;
  12.       this.timer = new Timer();
  13.       this.timer.schedule(this, 0L, 50L);
  14.    }
  15.  
  16.    public void run() {
  17.       this.parent.run();
  18.    }
  19.  
  20.    void stop() {
  21.       if (this.timer != null) {
  22.          ((TimerTask)this).cancel();
  23.          this.timer.cancel();
  24.          this.timer = null;
  25.       }
  26.    }
  27. }
  28.